using MediatR;
using RBAC.ErrorCode;
using System.ComponentModel.DataAnnotations;

namespace RBAC.Write.Api.Application.Command.ERP.SalesManagement.Return
{
    /// <summary>
    /// 创建退货通知单命令
    /// </summary>
    public class CreateReturnNoticeCommand : IRequest<APIResult<int>>
    {
        /// <summary>
        /// 单据编码
        /// </summary>
        public string? BillCode { get; set; }

        /// <summary>
        /// 业务类型
        /// </summary>
        public string? BusinessType { get; set; }

        /// <summary>
        /// 仓库
        /// </summary>
        public string? Warehouse { get; set; }

        /// <summary>
        /// 备注信息
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// 单据日期
        /// </summary>
        public DateTime? BillDate { get; set; }

        /// <summary>
        /// 操作员
        /// </summary>
        public string? Operator { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        public string? CustomerName { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public string? BillStatus { get; set; }

        /// <summary>
        /// 审批员
        /// </summary>
        public string? Reviewer { get; set; }

        /// <summary>
        /// 退货原因
        /// </summary>
        public string? ReturnReason { get; set; }

        /// <summary>
        /// 业务状态
        /// </summary>
        public string? BusinessStatus { get; set; }

        /// <summary>
        /// 审批日期
        /// </summary>
        public DateTime? ReviewDate { get; set; }

        /// <summary>
        /// 处理方式
        /// </summary>
        public string? ProcessingMethod { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 退货物料明细列表
        /// </summary>
        public List<CreateReturnMaterialDto>? Items { get; set; }
    }

    /// <summary>
    /// 创建退货物料明细DTO
    /// </summary>
    public class CreateReturnMaterialDto
    {
        /// <summary>
        /// 销售订单号
        /// </summary>
        public string? SalesOrderNumber { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string? MaterialCode { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string? MaterialName { get; set; }

        /// <summary>
        /// 主计量
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int? Quantity { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal? UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal? Amount { get; set; }

        /// <summary>
        /// 退货原因
        /// </summary>
        public string? ReturnReason { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }
    }
}